package org.jansansad.server;

import java.util.List;
import java.util.SortedSet;

import org.jansansad.client.GreetingService;
import org.jansansad.client.Member;
import org.jansansad.data.DataQuery;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

/**
 * The server side implementation of the RPC service.
 */
@SuppressWarnings("serial")
public class GreetingServiceImpl extends RemoteServiceServlet implements
		GreetingService {
	private final DataQuery dataQuery = new DataQuery();
	@Override
	public SortedSet<String> listStates() {
		return dataQuery.ListStates();
	}

	@Override
	public List<String> listConstituencies(String state) {
		return dataQuery.ListConstituencies(state);
	}

	@Override
	public Member getMpDetails(String constituency, String state) {
		return dataQuery.FindMemberByConstituencyAndState(constituency, state);
	}
}
